package io.gitee.hfl.rocketmq.handler.impl;

import io.gitee.hfl.rocketmq.handler.ISendCallbackHandler;
import org.apache.rocketmq.client.apis.producer.SendReceipt;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author 何福临
 * @date 2022-08-29 20:33
 */
public class DefaultSendCallbackHandler implements ISendCallbackHandler {

    private final Logger log = LoggerFactory.getLogger(this.getClass());

    @Override
    public void onSuccess(SendReceipt sendReceipt) {
        log.info("send success, messageId:{}.", sendReceipt.getMessageId());
    }

    @Override
    public void onError(SendReceipt sendReceipt, Throwable throwable) {
        log.error("send error, messageId:{}.", sendReceipt.getMessageId());
    }

}
